import CSSFormalSyntaxParser from './parser'

export const parser = CSSFormalSyntaxParser;

export const reference = {
    "integer": CSSFormalSyntaxParser.generateRegExpType(/^[+-]?([0-9]+)$/, "1"),
    "number": CSSFormalSyntaxParser.generateRegExpType(/^[+-]?([0-9]*\.[0-9]+|[0-9]+)(e[+-]?[0-9]+)?$/, "1"),
    "string": CSSFormalSyntaxParser.generateRegExpType(/(^'.*'$)|(^".*"$)/, "''"),
    "hex-color": CSSFormalSyntaxParser.generateRegExpType(/^#([a-f0-9]{3,4})$|^#([a-f0-9]{6})$|^#([a-f0-9]{8})$/i, "#fff"),

    "hash-token": CSSFormalSyntaxParser.generateRegExpType(/^#[a-z0-9_\-\x7F-\xFF]+$/i, "#hash"),

    "custom-ident": CSSFormalSyntaxParser.generateRegExpType(/^[a-z0-9-_\\]+$/i, "custom"),
    "dashed-ident": CSSFormalSyntaxParser.generateRegExpType(/^--[a-z0-9-_\\]+$/i, "--custom"),

    "length": CSSFormalSyntaxParser.generateRegExpListType(/^[+-]?([0-9]*\.[0-9]+|[0-9]+)(px|mm|cm|in|pt|pc|vb|vh|vi|vw|vmin|vmax|cap|ch|em|ex|ic|lh|rem|rlh)$/i, /^[+-]?(?:[0-9]*\.[0-9]+|[0-9]+)([a-z]+)?$/i, "1px", ["px", "mm", "cm", "in", "pt", "pc", "vb", "vh", "vi", "vw", "vmin", "vmax", "cap", "ch", "em", "ex", "ic", "lh", "rem", "rlh"]),
    "resolution": CSSFormalSyntaxParser.generateRegExpListType(/^[+-]?([0-9]*\.[0-9]+|[0-9]+)(dpi|dpcm|dppx)$/i, /^(?:[0-9]*\.[0-9]+|[0-9]+)([a-z]+)?$/i, "500dpi", ["dpi", "dpcm", "dppx"]),
    "time": CSSFormalSyntaxParser.generateRegExpListType(/^[+-]?([0-9]*\.[0-9]+|[0-9]+)(e[+-]?[0-9]+)?(s|ms)$/i, /^(?:[0-9]*\.[0-9]+|[0-9]+)([a-z]+)?$/i, "100ms", ["s", "ms"]),
    "angle": CSSFormalSyntaxParser.generateRegExpListType(/^([0-9]*\.[0-9]+|[0-9]+)(deg|grad|rad|turn)$/i, /^(?:[0-9]*\.[0-9]+|[0-9]+)([a-z]+)?$/i, "1deg", ["deg", "grad", "rad", "turn"]),
    "frequency": CSSFormalSyntaxParser.generateRegExpListType(/^([0-9]*\.[0-9]+|[0-9]+)(Hz|kHz)$/i, /^(?:[0-9]*\.[0-9]+|[0-9]+)([a-z]+)?$/i, "50hz", ["hz", "khz"]),
    "percentage": CSSFormalSyntaxParser.generateRegExpListType(/^[+|-]?([0-9]*\.[0-9]+|[0-9]+)(e[+-]?[0-9]+)?%$/i, /^[+|-]?(?:[0-9]*\.[0-9]+|[0-9]+)(e[+-]?[0-9]+)?$/i, "1%", ["%"]),

    "url": "url( [ <string> | <url-anything> ]? )", 	// Previously: /^url\((('.*')|(".*")|.*)\)$/i,
    "url-anything": /^[^\)]*$/,
    "ratio": "<integer> / <integer>",					// Previously: /^[+-]?[0-9]+\s*\/\s*[+|-]?[0-9]+$/i => error with the "/"

    "hue": "<number> | <angle>",
    "number-percentage": "<number> | <percentage>",
    "length-percentage": "<length> | <percentage>",

    "calc()": "calc( <calc-sum> )",
    "calc-sum": "<calc-product> [ [ '+' | '-' ] <calc-product> ]*",
    "calc-product": "<calc-value> [ '*' <calc-value> | '/' <calc-number-value> ]*",
    "calc-value": "<number> | <dimension> | <percentage> | ( <calc-sum> )",
    "calc-number-sum": "<calc-number-product> [ [ '+' | '-' ] <calc-number-product> ]*",
    "calc-number-product": "<calc-number-value> [ '*' <calc-number-value> | '/' <calc-number-value> ]*",
    "calc-number-value": "<number> | ( <calc-number-sum> )",

    "attr()": "attr( <attr-name> )",
    "attr-name": "<string> | <url-anything>",

    "br-width": "<length> | thin | medium | thick",
    "br-style": "none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset",
    "color": "<rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor", // | <deprecated-system-color>"
    "rgb()": "rgb( [ <percentage>{3} | <number>{3} ] [ / <alpha-value> ]? ) | rgb( [ <percentage>#{3} | <number>#{3} ] [, <alpha-value>]? )",
    "rgba()": "rgba( [ <percentage>{3} | <number>{3} ] [ / <alpha-value> ]? ) | rgba( [ <percentage>#{3} | <number>#{3} ] [, <alpha-value>]? )",
    "hsl()": "hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage> [, <alpha-value>]? )",
    "hsla()": "hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage> [, <alpha-value>]? )",
    "named-color": "transparent | black | silver | gray | white | maroon | red | purple | fuchsia | green | lime | olive | yellow | navy | blue | teal | aqua | orange | aliceblue | antiquewhite | aquamarine | azure | beige | bisque | blanchedalmond | blueviolet | brown | burlywood | cadetblue | chartreuse | chocolate | coral | cornflowerblue | cornsilk | crimson | cyan (synonyme de aqua) | darkblue | darkcyan | darkgoldenrod | darkgray | darkgreen | darkgrey | darkkhaki | darkmagenta | darkolivegreen | darkorange | darkorchid | darkred | darksalmon | darkseagreen | darkslateblue | darkslategray | darkslategrey | darkturquoise | darkviolet | deeppink | deepskyblue | dimgray | dimgrey | dodgerblue | firebrick | floralwhite | forestgreen | gainsboro | ghostwhite | gold | goldenrod | greenyellow | grey | honeydew | hotpink | indianred | indigo | ivory | khaki | lavender | lavenderblush | lawngreen | lemonchiffon | lightblue | lightcoral | lightcyan | lightgoldenrodyellow | lightgray | lightgreen | lightgrey | lightpink | lightsalmon | lightseagreen | lightskyblue | lightslategray | lightslategrey | lightsteelblue | lightyellow | limegreen | linen | magenta (synonyme de fuchsia) | mediumaquamarine | mediumblue | mediumorchid | mediumpurple | mediumseagreen | mediumslateblue | mediumspringgreen | mediumturquoise | mediumvioletred | midnightblue | mintcream | mistyrose | moccasin | navajowhite | oldlace | olivedrab | orangered | orchid | palegoldenrod | palegreen | paleturquoise | palevioletred | papayawhip | peachpuff | peru | pink | plum | powderblue | rosybrown | royalblue | saddlebrown | salmon | sandybrown | seagreen | seashell | sienna | skyblue | slateblue | slategray | slategrey | snow | springgreen | steelblue | tan | thistle | tomato | turquoise | violet | wheat | whitesmoke | yellowgreen | rebeccapurple",
    "side-or-corner": "[ left | right ] || [ top | bottom ]",
    "color-stop-list": "<color-stop>#{2,}",
    "color-stop": "<color> <length-percentage>?",
    "alpha-value": "<number> | <percentage>",
    "ending-shape": "circle | ellipse",
    "size": "closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}",
    "image": "<url>",
    "image()": "image( <image-tags>? [ <image-src>? , <color>? ]! )",
    "image-tags": "ltr | rtl",
    "image-src": "<url> | <string>",
    "image-set()": "image-set( <image-set-option># )",
    "image-set-option": "<string> <resolution>",
    "shadow": "inset? && <length>{2,4} && <color>?",
    "shape-radius": "<length-percentage> | closest-side | farthest-side",
    "position": "[ [ left | center | right ] || [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]",
    "fill-rule": "nonzero | evenodd",
    "box": "border-box | padding-box | content-box",

    "baseline-position": "[ first | last ]? baseline",
    "content-distribution": "space-between | space-around | space-evenly | stretch",
    "overflow-position": "unsafe | safe",
    "content-position": "center | start | end | flex-start | flex-end",
    "self-position": "center | start | end | self-start | self-end | flex-start | flex-end",

    "font-variant-css21": "normal | small-caps",

    "single-animation": "<time> || <timing-function> || <time> || <single-animation-iteration-count> || <single-animation-direction> || <single-animation-fill-mode> || <single-animation-play-state> || [ none | <keyframes-name> ]",
    "single-animation-direction": "normal | reverse | alternate | alternate-reverse",
    "single-animation-fill-mode": "none | forwards | backwards | both",
    "single-animation-play-state": "running | paused",
    "single-animation-iteration-count": "infinite | <number>",
    "single-timing-function": "linear | <cubic-bezier-timing-function> | <step-timing-function> | <frames-timing-function>",
    "keyframes-name": "<custom-ident> | <string>",

    "timing-function": "linear | <cubic-bezier-timing-function> | <step-timing-function>",
    "step-timing-function": "step-start | step-end | steps(<integer>[, <step-position>]?)",
    "step-position": "jump-start | jump-end | jump-none | jump-both | start | end",
    "frames-timing-function": "frames(<integer>)",

    "clip-source": "<url>",
    "basic-shape": "<inset()> | <circle()> | <ellipse()> | <polygon()>",
    "geometry-box": "<shape-box> | fill-box | stroke-box | view-box",
    "inset()": "inset( <length-percentage>{1,4} [ round <'border-radius'> ]? )",
    "circle()": "circle( [ <shape-radius> ]? [ at <position> ]? )",
    "ellipse()": "ellipse( [ <shape-radius>{2} ]? [ at <position> ]? )",
    "polygon()": "polygon( <fill-rule>? , [ <length-percentage> <length-percentage> ]# )",
    "shape-box": "<box> | margin-box",

    "content-replacement": "<image>",
    "content-list": "[ <string> | contents | <image> | <quote> | <target> | <leader()> ]+",
    "quote": "open-quote | close-quote | no-open-quote | no-close-quote",
    "target": "<target-counter()> | <target-counters()> | <target-text()>",
    "leader()": "leader( <leader-type> )",
    "element()": "element( <id-selector> )",
    "cross-fade()": "cross-fade( <cf-mixing-image> , <cf-final-image>? )",
    "gradient": "<linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()>",
    "target-counter()": "target-counter( [ <string> | <url> ] , <custom-ident> , <counter-style>? )",
    "target-counters()": "target-counters( [ <string> | <url> ] , <custom-ident> , <string> , <counter-style>? )",
    "target-text()": "target-text( [ <string> | <url> ] , [ content | before | after | first-letter ]? )",
    "leader-type": "dotted | solid | space | <string>",
    "id-selector": "<hash-token>",
    "cf-mixing-image": "<percentage>? && <image>",
    "cf-final-image": "<image> | <color>",
    "linear-gradient()": "linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )",
    "radial-gradient()": "radial-gradient( [ <ending-shape> || <size> ]? [ at <position> ]? , <color-stop-list> )",
    "repeating-linear-gradient()": "repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )",
    "repeating-radial-gradient()": "repeating-radial-gradient( [ <ending-shape> || <size> ]? [ at <position> ]? , <color-stop-list> )",
    "counter-style": "<counter-style-name> | symbols()",
    "counter-style-name": "<custom-ident>",
    "color-stop": "<color> <length-percentage>?",

    "display-outside": "block | inline | run-in",
    "display-inside": "flow | flow-root | table | flex | grid | subgrid | ruby",
    "display-listitem": "<display-outside>? && [ flow | flow-root ]? && list-item",
    "display-internal": "table-row-group | table-header-group | table-footer-group | table-row | table-cell | table-column-group | table-column | table-caption | ruby-base | ruby-text | ruby-base-container | ruby-text-container",
    "display-box": "contents | none",
    "display-legacy": "inline-block | inline-list-item | inline-table | inline-flex | inline-grid",

    "matrix()": "matrix( <number> [, <number>]{5,5} )",
    "blur()": "blur(<length>)",
    "brightness()": "brightness(<number> | <percentage>)",
    "blend-mode": "normal | multiply | screen | overlay | darken | lighten | color-dodge | color-burn | hard-light | soft-light | difference | exclusion | hue | saturation | color | luminosity",

    "family-name": "<string> | <custom-ident>+",
    "generic-family": "serif | sans-serif | cursive | fantasy | monospace",
    "feature-tag-value": "<string> [ <integer> | on | off ]?",
    "absolute-size": "xx-small | x-small | small | medium | large | x-large | xx-large",
    "relative-size": "larger | smaller",

    "font-stretch-absolute": "normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | <percentage>",
    "common-lig-values": "common-ligatures | no-common-ligatures",
    "discretionary-lig-values": "discretionary-ligatures | no-discretionary-ligatures",
    "historical-lig-values": "historical-ligatures | no-historical-ligatures",
    "contextual-alt-values": "contextual | no-contextual",
    "feature-value-name": "<custom-ident>",
    "numeric-figure-values": "lining-nums | oldstyle-nums",
    "numeric-spacing-values": "proportional-nums | tabular-nums",
    "numeric-fraction-values": "diagonal-fractions | stacked-fractions",
    "east-asian-variant-values": "jis78 | jis83 | jis90 | jis04 | simplified | traditional",
    "east-asian-width-values": "full-width | proportional-width",
    "feature-value-name": "<custom-ident>",
    "discretionary-lig-values": "discretionary-ligatures | no-discretionary-ligatures",
    "historical-lig-values": "historical-ligatures | no-historical-ligatures",
    "contextual-alt-values": "contextual | no-contextual",

    "numeric-figure-values": "lining-nums | oldstyle-nums",
    "numeric-spacing-values": "proportional-nums | tabular-nums",
    "numeric-fraction-values": "diagonal-fractions | stacked-fractions",

    "font-weight-absolute": "normal | bold | <number>",

    "line-names": "'[' <custom-ident>* ']'",
    "track-size": "<track-breadth> | minmax( <inflexible-breadth> , <track-breadth> ) | fit-content( [ <length> | <percentage> ] )",
    "track-repeat": "repeat( [ <integer[0,∞]> ] , [ <line-names>? <track-size> ]+ <line-names>? )",	// <positive-integer> is not referenced => integer[0, ∞]
    "track-breadth": "<length-percentage> | <'flex'> | min-content | max-content | auto",
    "track-list": "[ <line-names>? [ <track-size> | <track-repeat> ] ]+ <line-names>?",
    "explicit-track-list": "[ <line-names>? <track-size> ]+ <line-names>?",
    "inflexible-breadth": "<length> | <percentage> | min-content | max-content | auto",
    "fixed-breadth": "<length-percentage>",
    "fixed-size": "<fixed-breadth> | minmax( <fixed-breadth> , <track-breadth> ) | minmax( <inflexible-breadth> , <fixed-breadth> )",
    "fixed-repeat": "repeat( [ <integer[0,∞]> ] , [ <line-names>? <fixed-size> ]+ <line-names>? )",	// <positive-integer> is not referenced => integer[0, ∞]
    "auto-track-list": "[ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>? <auto-repeat> [ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>?",
    "auto-repeat": "repeat( [ auto-fill | auto-fit ] , [ <line-names>? <fixed-size> ]+ <line-names>? )",

    "mask-layer": "<mask-reference> || <position> [ / <bg-size> ]? || <repeat-style> || <geometry-box> || [ <geometry-box> | no-clip ] || <compositing-operator> || <masking-mode>",
    "mask-reference": "none | <image> | <mask-source>",
    "repeat-style": "repeat-x | repeat-y | [ repeat | space | round | no-repeat ]{1,2}",
    "geometry-box": "<shape-box> | fill-box | stroke-box | view-box",
    "compositing-operator": "add | subtract | intersect | exclude",
    "masking-mode": "alpha | luminance | match-source",
    "mask-source": "<url>",
    "masking-mode": "alpha | luminance | match-source",

    "blend-mode": "normal | multiply | screen | overlay | darken | lighten | color-dodge | color-burn | hard-light | soft-light | difference | exclusion | hue | saturation | color | luminosity",

    "line-width": "<length> | thin | medium | thick",
    "shadow-t": "[ <length>{2,3} && <color>? ]",

    "transform-list": "<transform-function>+",
    "transform-function": "<matrix()> | <translate()> | <translateX()> | <translateY()> | <scale()> | <scaleX()> | <scaleY()> | <skew()> | <skewX()> | <skewY()> | <matrix3d()> | <translate3d()> | <translateZ()> | <scale3d()> | <scaleZ()> | <rotate3d()> | <rotate()> | <rotateX()> | <rotateY()> | <rotateZ()> | <perspective()>",
    "scale()": "scale( <number> [, <number>]? )",
    "scale3d()": "scale3d( <number>#{3} )",
    "scaleX()": "scaleX( <number> )",
    "scaleY()": "scaleY( <number> )",
    "scaleZ()": "scaleZ( <number> )",
    "skew()": "skew( <angle> [, <angle> ]? )",
    "skewX()": "skewX( <angle> )",
    "skewY()": "skewY( <angle> )",
    "rotate()": "rotate( <angle> )",
    "rotate3d()": "rotate3d( <number> , <number> , <number> , <angle> )",
    "rotateX()": "rotateX( <angle> )",
    "rotateY()": "rotateY( <angle> )",
    "rotateZ()": "rotateZ( <angle> )",
    "translate()": "translate( <length-percentage> , <length-percentage>? )",
    "translate3d()": "translate3d( <length-percentage> , <length-percentage> , <length> )",
    "translateX()": "translateX( <length-percentage> )",
    "translateY()": "translateY( <length-percentage> )",
    "translateZ()": "translateZ( <length> )",
    "matrix3d()": "matrix3d( <number>#{16} )",
    "perspective()": "perspective( <length> )",

    "single-transition": "[ none | <single-transition-property> ] || <time> || <timing-function> || <time>",
    "single-transition-property": "all | <custom-ident>",

    "cubic-bezier-timing-function": "ease | ease-in | ease-out | ease-in-out | cubic-bezier(<number>[0,1], <number>, <number>[0,1], <number>)",
    "single-transition-property": "all | <custom-ident>",

    "animateable-feature": "scroll-position | contents | <custom-ident>",

    "bg-layer": "<bg-image> || <bg-position> [ / <bg-size> ]? || <repeat-style> || <attachment> || <box>",
    "final-bg-layer": "<'background-color'> || <bg-image> || <bg-position> [ / <bg-size> ]? || <repeat-style> || <attachment> || <box>",
    "bg-image": "none | <image>",
    "bg-position": "[ left | center | right | top | bottom | <length-percentage> ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ] | [ center | [ left | right ] <length-percentage>? ] && [ center | [ top | bottom ] <length-percentage>? ]",
    "bg-size": "[ <length-percentage> | auto ]{1,2} | cover | contain",
    "attachment": "scroll | fixed | local",

    "grid-line": "auto | <custom-ident> | [ <integer> && <custom-ident>? ] | [ span && [ <integer> || <custom-ident> ] ]"
};

export const propertyReference = {	// https://developer.mozilla.org/fr/docs/Web/CSS/Reference
    "all": "revert",

    "align-content": "normal | <baseline-position> | <content-distribution> | <overflow-position>? <content-position>",
    "align-items": "normal | stretch | <baseline-position> | [ <overflow-position>? <self-position> ]",
    "align-self": "auto | normal | stretch | <baseline-position> | <overflow-position>? <self-position>",

    "animation": "<single-animation>#",
    "animation-delay": "<time>#",
    "animation-direction": "<single-animation-direction>#",
    "animation-duration": "<time>#",
    "animation-fill-mode": "<single-animation-fill-mode>#",
    "animation-iteration-count": "<single-animation-iteration-count>#",
    "animation-name": "[ none | <keyframes-name> ]#",
    "animation-play-state": "running | paused",
    "animation-timing-function": "<single-timing-function>#",

    "background": "[ <bg-layer> , ]* <final-bg-layer>",
    "background-attachment": "<attachment>#",
    "background-blend-mode": "normal | multiply | screen | overlay | darken | lighten | color-dodge | color-burn | hard-light | soft-light | difference | exclusion | hue | saturation | color | luminosity",
    "background-clip": "<box>#",
    "background-color": "<color>",
    "background-repeat": "<repeat-style>#",
    "background-size": "<bg-size>#",
    "background-position": "<bg-position>#",
    "background-origin": "<box>#",
    "background-image": "<bg-image>#",

    "border": "<br-width> || <br-style> || <color>",
    "border-width": "<br-width>{1,4}",
    "border-style": "<br-style>{1,4}",
    "border-color": "<color>{1,4}",
    "border-collapse": "collapse | separate",
    "border-spacing": "<length> <length>?",

    "border-image": "<'border-image-source'> || <'border-image-slice'> [ / <'border-image-width'> | / <'border-image-width'>? / <'border-image-outset'> ]? || <'border-image-repeat'>",
    "border-image-outset": "[ <length> | <number> ]{1,4}",
    "border-image-repeat": "[ stretch | repeat | round | space ]{1,2}",
    "border-image-slice": "<number-percentage>{1,4} && fill?",
    "border-image-source": "none | <image>",
    "border-image-width": "[ <length-percentage> | <number> | auto ]{1,4}",

    "border-top": "<br-width> || <br-style> || <color>",
    "border-top-width": "<br-width>",
    "border-top-style": "<br-style>",
    "border-top-color": "<color>",
    "border-top-left-radius": "<length-percentage>{1,2}",
    "border-top-right-radius": "<length-percentage>{1,2}",

    "border-radius": "<length-percentage>{1,4} [ / <length-percentage>{1,4} ]?",
    "border-right": "<br-width> || <br-style> || <color>",
    "border-right-width": "<br-width>",
    "border-right-style": "<br-style>",
    "border-right-color": "<color>",

    "border-bottom": "<br-width> || <br-style> || <color>",
    "border-bottom-width": "<br-width>",
    "border-bottom-style": "<br-style>",
    "border-bottom-color": "<color>",
    "border-bottom-left-radius": "<length-percentage>{1,2}",
    "border-bottom-right-radius": "<length-percentage>{1,2}",

    "border-left": "<br-width> || <br-style> || <color>",
    "border-left-width": "<br-width>",
    "border-left-style": "<br-style>",
    "border-left-color": "<color>",

    "box-shadow": "none | <shadow>#",
    "box-sizing": "content-box | border-box",

    "break-after": "auto | avoid | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region",
    "break-before": "auto | avoid | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region",
    "break-inside": "auto | avoid | avoid-page | avoid-column | avoid-region",

    "caption-side": "top | bottom",
    "caret-color": "auto | <color>",
    "clear": "none | left | right | both | inline-start | inline-end",
    "clip-path": "<clip-source> | [ <basic-shape> || <geometry-box> ] | none",

    "column-count": "<integer> | auto",
    "column-fill": "auto | balance | balance-all",
    "column-gap": "normal | <length-percentage>",
    "column-rule": "<'column-rule-width'> || <'column-rule-style'> || <'column-rule-color'>",
    "column-rule-color": "<color>",
    "column-rule-style": "<'border-style'>",
    "column-rule-width": "<'border-width'>",
    "column-span": "none | all",
    "column-width": "<length> | auto",
    "columns": "<'column-width'> || <'column-count'>",

    "content": "normal | none | [ <content-replacement> | <content-list> ] [/ <string> ]?",

    "counter-increment": "[ <custom-ident> <integer>? ]+ | none",
    "counter-reset": "[ <custom-ident> <integer>? ]+ | none",

    "cursor": "[ [ <url> [ <integer> <integer> ]? , ]* [ auto | default | none | context-menu | help | pointer | progress | wait | cell | crosshair | text | vertical-text | alias | copy | move | no-drop | not-allowed | e-resize | n-resize | ne-resize | nw-resize | s-resize | se-resize | sw-resize | w-resize | ew-resize | ns-resize | nesw-resize | nwse-resize | col-resize | row-resize | all-scroll | zoom-in | zoom-out | grab | grabbing ] ]",

    "direction": "ltr | rtl",
    "display": "[ <display-outside> || <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy>",

    "empty-cells": "show | hide",

    "top": "<length> | <percentage> | auto",
    "right": "<length> | <percentage> | auto",
    "left": "<length> | <percentage> | auto",
    "bottom": "<length> | <percentage> | auto",

    "flex": "none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]",
    "flex-basis": "content | <'width'>",
    "flex-direction": "row | row-reverse | column | column-reverse",
    "flex-flow": "<'flex-direction'> || <'flex-wrap'>",
    "flex-grow": "<number>",
    "flex-shrink": "<number>",
    "flex-wrap": "nowrap | wrap | wrap-reverse",
    "float": "left | right | none | inline-start | inline-end",

    "font": "[ [ <'font-style'> || <font-variant-css21> || <'font-weight'> || <'font-stretch'> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption | icon | menu | message-box | small-caption | status-bar",
    "font-family": "[ <family-name> | <generic-family> ]#",
    "font-feature-settings": "normal | <feature-tag-value>#",
    "font-kerning": "auto | normal | none",
    "font-language-override": "normal | <string>",
    "font-size": "<absolute-size> | <relative-size> | <length-percentage>",
    "font-size-adjust": "none | <number>",
    "font-stretch": "<font-stretch-absolute>",
    "font-style": "normal | italic | oblique",
    "font-synthesis": "none | [ weight || style ]",
    "font-variant": "normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> || stylistic( <feature-value-name> ) || historical-forms || styleset( <feature-value-name># ) || character-variant( <feature-value-name># ) || swash( <feature-value-name> ) || ornaments( <feature-value-name> ) || annotation( <feature-value-name> ) || [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] || <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero || <east-asian-variant-values> || <east-asian-width-values> || ruby ]",
    "font-variant-alternates": "normal | [ stylistic( <feature-value-name> ) || historical-forms || styleset( <feature-value-name># ) || character-variant( <feature-value-name># ) || swash( <feature-value-name> ) || ornaments( <feature-value-name> ) || annotation( <feature-value-name> ) ]",
    "font-variant-caps": "normal | small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps",
    "font-variant-east-asian": "normal | [ <east-asian-variant-values> || <east-asian-width-values> || ruby ]",
    "font-variant-ligatures": "normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> ]",
    "font-variant-numeric": "normal | [ <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero ]",
    "font-variant-position": "normal | sub | super",
    "font-weight": "<font-weight-absolute> | bolder | lighter",

    "grid": "<'grid-template'> | <'grid-template-rows'> / [ auto-flow && dense? ] <'grid-auto-columns'>? | [ auto-flow && dense? ] <'grid-auto-rows'>? / <'grid-template-columns'>",
    "grid-area": "<grid-line> [ / <grid-line> ]{0,3}",
    "grid-auto-columns": "<track-size>+",
    "grid-auto-flow": "[ row | column ] || dense",
    "grid-auto-rows": "<track-size>+",
    "grid-column": "<grid-line> [ / <grid-line> ]?",
    "grid-column-end": "<grid-line>",
    "grid-column-start": "<grid-line>",
    "grid-gap": "<'row-gap'> <'column-gap'>?",
    "grid-row": "<grid-line> [ / <grid-line> ]?",
    "grid-row-end": "<grid-line>",
    "grid-row-gap": "normal | <length-percentage>",
    "grid-row-start": "<grid-line>",
    "grid-template": "none | [ <'grid-template-rows'> / <'grid-template-columns'> ] | [ <line-names>? <string> <track-size>? <line-names>? ]+ [ / <explicit-track-list> ]?",
    "grid-template-areas": "none | <string>+",
    "grid-template-columns": "none | <track-list> | <auto-track-list>",
    "grid-template-rows": "none | <track-list> | <auto-track-list>",

    "hanging-punctuation": "none | [ first || [ force-end | allow-end ] || last ]",
    "height": "[ <length> | <percentage> ] && [ border-box | content-box ]? | available | min-content | max-content | fit-content | auto",
    "hyphens": "none | manual | auto",

    "isolation": "auto | isolate",

    "justify-content": "normal | <content-distribution> | <overflow-position>? [ <content-position> | left | right ]",
    "justify-items": "normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ] | legacy | legacy && [ left | right | center ]",
    "justify-self": "auto | normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ]",

    "letter-spacing": "normal | <length>",
    "line-break": "auto | loose | normal | strict",
    "line-height": "normal | <number> | <length> | <percentage>",
    "list-style": "<'list-style-type'> || <'list-style-position'> || <'list-style-image'>",
    "list-style-image": "<url> | none",
    "list-style-position": "inside | outside",
    "list-style-type": "<counter-style> | <string> | none",

    "margin": "[ <length> | <percentage> | auto ]{1,4}",
    "margin-bottom": "<length> | <percentage> | auto",
    "margin-left": "<length> | <percentage> | auto",
    "margin-right": "<length> | <percentage> | auto",
    "margin-top": "<length> | <percentage> | auto",

    "mask": "<mask-layer>#",
    "mask-clip": "[ <geometry-box> | no-clip ]#",
    "mask-composite": "<compositing-operator>#",
    "mask-image": "<mask-reference>#",
    "mask-mode": "<masking-mode>#",
    "mask-origin": "<geometry-box>#",
    "mask-position": "<position>#",
    "mask-repeat": "<repeat-style>#",
    "mask-size": "<bg-size>#",
    "mask-type": "luminance | alpha",
    "max-height": "<length> | <percentage> | none | max-content | min-content | fit-content | fill-available",
    "max-width": "<length> | <percentage> | none | max-content | min-content | fit-content | fill-available",
    "min-height": "<length> | <percentage> | none | max-content | min-content | fit-content | fill-available",
    "min-width": "auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)",
    "min-block-size": "<'min-width'>",
    "min-inline-size": "<'min-width'>",
    "mix-blend-mode": "<blend-mode>",

    "object-fit": "fill | contain | cover | none | scale-down",
    "object-position": "<position>",
    "opacity": "<alpha-value>",
    "order": "<integer>",
    "orphans": "<integer>",

    "outline": "[ <'outline-color'> || <'outline-style'> || <'outline-width'> ]",
    "outline-color": "<color> | invert",
    "outline-offset": "<length>",
    "outline-style": "auto | <'border-style'>",
    "outline-width": "<line-width>",

    "overflow": "[ visible | hidden | clip | scroll | auto ]{1,2}",
    "overflow-wrap": "normal | break-word | anywhere",
    "overflow-x": "visible | hidden | clip | scroll | auto",
    "overflow-y": "visible | hidden | clip | scroll | auto",

    "padding": "[ <length> | <percentage> ]{1,4}",
    "padding-block": "<'padding-left'>{1,2}",
    "padding-block-end": "<'padding-left'>",
    "padding-block-start": "<'padding-left'>",
    "padding-bottom": "<length> | <percentage>",
    "padding-inline": "<'padding-left'>{1,2}",
    "padding-inline-end": "<'padding-left'>",
    "padding-inline-start": "<'padding-left'>",
    "padding-left": "<length> | <percentage>",
    "padding-right": "<length> | <percentage>",
    "padding-top": "<length> | <percentage>",

    "perspective": "none | <length>",
    "perspective-origin": "<position>",
    "place-content": "<'align-content'> <'justify-content'>?",
    "place-items": "<'align-items'> <'justify-items'>?",
    "place-self": "<'align-self'> <'justify-self'>?",
    "pointer-events": "auto | none | visiblePainted | visibleFill | visibleStroke | visible | painted | fill | stroke | all | inherit",
    "position": "static | relative | absolute | sticky | fixed",

    "quotes": "none | auto | [ <string> <string> ]+",
    "resize": "none | both | horizontal | vertical | block | inline",
    "rotate": "none | <angle> | [ x | y | z | <number>{3} ] && <angle>",
    "row-gap": "normal | <length-percentage>",
    "scale": "none | <number>{1,3}",

    "scroll-behavior": "auto | smooth",
    "scroll-margin": "<length>{1,4}",
    "scroll-margin-block": "<length>{1,2}",
    "scroll-margin-block-end": "<length>",
    "scroll-margin-block-start": "<length>",
    "scroll-margin-bottom": "<length>",
    "scroll-margin-inline": "<length>{1,2}",
    "scroll-margin-inline-end": "<length>",
    "scroll-margin-inline-start": "<length>",
    "scroll-margin-left": "<length>",
    "scroll-margin-right": "<length>",
    "scroll-margin-top": "<length>",
    "scroll-padding": "[ auto | <length-percentage> ]{1,4}",
    "scroll-padding-block": "[ auto | <length-percentage> ]{1,2}",
    "scroll-padding-block-end": "auto | <length-percentage>",
    "scroll-padding-block-start": "auto | <length-percentage>",
    "scroll-padding-bottom": "auto | <length-percentage>",
    "scroll-padding-inline": "[ auto | <length-percentage> ]{1,2}",
    "scroll-padding-inline-end": "auto | <length-percentage>",
    "scroll-padding-inline-start": "auto | <length-percentage>",
    "scroll-padding-left": "auto | <length-percentage>",
    "scroll-padding-right": "auto | <length-percentage>",
    "scroll-padding-top": "auto | <length-percentage>",
    "scroll-snap-align": "[ none | start | end | center ]{1,2}",
    "scroll-snap-stop": "normal | always",
    "scroll-snap-type": "none | [ x | y | block | inline | both ] [ mandatory | proximity ]?",
    "scrollbar-color": "auto | dark | light | <color>{2}",
    "scrollbar-width": "auto | thin | none",

    "shape-image-threshold": "<alpha-value>",
    "shape-margin": "<length-percentage>",
    "shape-outside": "none | <shape-box> || <basic-shape> | <image>",

    "tab-size": "<integer> | <length>",
    "table-layout": "auto | fixed",

    "text-align": "start | end | left | right | center | justify | match-parent",
    "text-align-last": "auto | start | end | left | right | center | justify",
    "text-combine-upright": "none | all | [ digits <integer>? ]",
    "text-decoration": "<'text-decoration-line'> || <'text-decoration-style'> || <'text-decoration-color'> || <'text-decoration-thickness'>",
    "text-decoration-color": "<color>",
    "text-decoration-line": "none | [ underline || overline || line-through || blink ] | spelling-error | grammar-error",
    "text-decoration-style": "solid | double | dotted | dashed | wavy",
    "text-decoration-thickness": "auto | from-font | <length> | <percentage>",
    "text-emphasis": "<'text-emphasis-style'> || <'text-emphasis-color'>",
    "text-emphasis-color": "<color>",
    "text-emphasis-position": "[ over | under ] && [ right | left ]",
    "text-emphasis-style": "none | [ [ filled | open ] || [ dot | circle | double-circle | triangle | sesame ] ] | <string>",
    "text-indent": "<length-percentage> && hanging? && each-line?",
    "text-justify": "auto | inter-character | inter-word | none",
    "text-orientation": "mixed | upright | sideways",
    "text-overflow": "[ clip | ellipsis | <string> ]{1,2}",
    "text-rendering": "auto | optimizeSpeed | optimizeLegibility | geometricPrecision",
    "text-shadow": "none | <shadow-t>#",
    "text-transform": "none | capitalize | uppercase | lowercase | full-width | full-size-kana",
    "text-underline-position": "auto | from-font | [ under || [ left | right ] ]",

    "top": "<length> | <percentage> | auto",
    "touch-action": "auto | none | [ [ pan-x | pan-left | pan-right ] || [ pan-y | pan-up | pan-down ] || pinch-zoom ] | manipulation",
    "transform": "none | <transform-list>",
    "transform-box": "content-box | border-box | fill-box | stroke-box | view-box",
    "transform-origin": "[ <length-percentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?",
    "transform-style": "flat | preserve-3d",
    "transition": "<single-transition>#",
    "transition-delay": "<time>#",
    "transition-duration": "<time>#",
    "transition-property": "none | <single-transition-property>#",
    "transition-timing-function": "<timing-function>#",
    "translate": "none | <length-percentage> [ <length-percentage> <length>? ]?",

    "unicode-bidi": "normal | embed | isolate | bidi-override | isolate-override | plaintext",
    "vertical-align": "baseline | sub | super | text-top | text-bottom | middle | top | bottom | <percentage> | <length>",
    "visibility": "visible | hidden | collapse",
    "white-space": "normal | pre | nowrap | pre-wrap | pre-line | break-spaces",
    "widows": "<integer>",
    "width": "auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)",
    "will-change": "auto | <animateable-feature>#",
    "word-break": "normal | break-all | keep-all | break-word",
    "word-spacing": "normal | <length-percentage>",
    "word-wrap": "normal | break-word | anywhere",
    "writing-mode": "horizontal-tb | vertical-rl | vertical-lr | sideways-rl | sideways-lr",

    "z-index": "auto | <integer>"
};

CSSFormalSyntaxParser.setBasicDataType(reference);
CSSFormalSyntaxParser.setProperty(propertyReference);